package com.hsbc.dev.teamo4.sms.sm.controller;

import com.hsbc.dev.teamo4.sms.common.fields.ResponseResults;
import com.hsbc.dev.teamo4.sms.sm.po.Permission;
import com.hsbc.dev.teamo4.sms.sm.service.IPermissionService;
import com.hsbc.dev.teamo4.sms.sm.service.impl.PermissionServiceImpl;

/**
 * @author:Kevin
 * @version:
 * @Project: permission_manage
 * @Package: com.hsbc.dev.teamo4.sms.sm.controller
 * @Description: permission Controller
 * @Date date: 2018/7/26
 */
public class PermissionController {
    private IPermissionService iPermissionService=new PermissionServiceImpl();

    /**
     *  add permission
     * @param permission
     * @return ResponseResults
     */
    public ResponseResults addPermission(Permission permission){
        return ResponseResults.responseBySuccess("ok",iPermissionService.save(permission));
    }

    /**
     * update permission
     * @param permission
     * @return ResponseResults
     */
    public ResponseResults updatePermission(Permission permission){
        return ResponseResults.responseBySuccess("ok",iPermissionService.update(permission));
    }

    /**
     * query Permission By Id
     * @param id
     * @return ResponseResults
     */
    public ResponseResults queryPermissionById(String id){
        return ResponseResults.responseBySuccess("ok",iPermissionService.queryById(id));
    }


}
